<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@page import="entity.product_category"%>
<%@page import="dao.Product_categoryDao"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dao.recently_dao"%>
<%@page import="dao.ProductDao"%>
<%@page import="entity.Product"%>
<%@page import="entity.recently"%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>易买网 - 首页</title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="scripts/function.js"></script>
</head>
<body>
<div id="header" class="wrap">
	<div id="logo"><img src="images/logo.gif" /></div>
	<div class="help"><a href="#" class="shopping">购物车</a><a href="login.html">登录</a><a href="register.html">注册</a><a href="guestbook.jsp">留言</a></div>
	<div class="navbar">
		<ul class="clearfix">
			<li class="current"><a href="index.jsp">首页</a></li>
			<li><a href="#">图书</a></li>
			<li><a href="#">百货</a></li>
			<li><a href="#">品牌</a></li>
			<li><a href="#">促销</a></li>
		</ul>
	</div>
</div>
<div id="childNav">
	<div class="wrap">
		<ul class="clearfix">
			<li class="first"><a href="#">音乐</a></li>
			<li><a href="#">影视</a></li>
			<li><a href="#">少儿</a></li>
			<li><a href="#">动漫</a></li>
			<li><a href="#">小说</a></li>
			<li><a href="#">外语</a></li>
			<li><a href="#">数码相机</a></li>
			<li><a href="#">笔记本</a></li>
			<li><a href="#">羽绒服</a></li>
			<li><a href="#">秋冬靴</a></li>
			<li><a href="#">运动鞋</a></li>
			<li><a href="#">美容护肤</a></li>
			<li><a href="#">家纺用品</a></li>
			<li><a href="#">婴幼奶粉</a></li>
			<li><a href="#">饰品</a></li>
			<li class="last"><a href="#">Investor Relations</a></li>
		</ul>
	</div>
</div>
<div id="position" class="wrap">
	您现在的位置：<a href="index.html">易买网</a> &gt; <a href="product-list.html">图书音像</a> &gt; 图书
</div>
<div id="main" class="wrap">
	<div class="lefter">
		<div class="box">
			<h2>商品分类</h2>
			<dl>
				<%
			ArrayList<product_category> pclist=new Product_categoryDao().select();			
			%>
			<%
			for(int i =0;i<pclist.size();i++){
				product_category p = pclist.get(i);
				if(p.getEPC_PARENT_ID()==0){
					 ArrayList<product_category> pare=
						 new Product_categoryDao().selectpare(p.getEPC_ID());
					%>
					<dt><%=p.getEPC_NAME() %></dt>
					<%
					for(int j =0;j<pare.size();j++){
						product_category pj = pare.get(j);
						%>
						<dd><a href="product-list.jsp"><%=pj.getEPC_NAME() %></a></dd>
					<%
				}
				}}
			%>
			</dl>
		</div>
		
		
		<dl>
				<c:forEach items="${product}" var="pc1">
					<c:if test="${pc1.EPC_PARENT_ID==0}">
					<dt>
						${pclist.EPC_NAME }
					</dt>
					<c:forEach items="${product}" var="pc2">
						<c:if test="${pc1.EPC_ID==pc2.EPC_PARENT_ID}">
						<dd>
							<a herf="IndexServlet">${pc2.EPC_NAME }</a>
						</dd>
						</c:if>
					</c:forEach>
					</c:if>
				</c:forEach>
		</dl>
		
		<%
			recently_dao rd = new recently_dao();
			ProductDao pd = new ProductDao();
			ArrayList<Product> prli = pd.select();
			ArrayList<recently> reli = rd.selectByUid();
			
			
		%>
		<div class="spacer"></div>
		<div class="last-view">
			<h2>最近浏览</h2>
			<dl class="clearfix">
				<%for(int k=0;k<reli.size();k++){
				recently rc = reli.get(k);
				Product pro = pd.selectbyid(rc.getR_p_id());
				%>
				<dt>
				<a href="ProductviewServlet?epid=<%=pro.getEpid() %>">
				<img style="width: 40px" src="images/product/<%=pro.getEpfilename() %>" />
				</a>
				</dt>
				<dd><a href="ProductviewServlet?epid=<%=pro.getEpid() %>"><%=pro.getEpname() %></a></dd>
				
				<%
				
				
			} %>
			</dl>
			<script type="text/javascript">
				document.write("Cookie中记录的购物车商品ID："+ getCookie("product") + "，可以在动态页面中进行读取");
			</script>
		</div>
	</div>
	<div class="main">
		<div class="product-list">
			<h2>全部商品</h2>
			<div class="pager">
				<ul class="clearfix">
					<li><a href="#">上一页</a></li>
					<li class="current">1</li>
					<li><a href="#">2</a></li>
					<li><a href="#">3</a></li>
					<li><a href="#">4</a></li>
					<li><a href="#">5</a></li>
					<li><a href="#">下一页</a></li>
				</ul>
			</div>
			<div class="clear"></div>
			<ul class="product clearfix">
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/1.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">法国德菲丝松露精品巧克力500g/盒</a></dd>
						<dd class="price">￥108.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/2.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">乐扣普通型保鲜盒圣诞7件套</a></dd>
						<dd class="price">￥69.90</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/3.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">欧珀莱均衡保湿四件套</a></dd>
						<dd class="price">￥279.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/4.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">联想笔记本电脑 高速独立显存</a></dd>
						<dd class="price">￥4199</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/5.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">法姿韩版显瘦彩边时尚牛仔铅笔裤</a></dd>
						<dd class="price">￥49.00</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/6.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">Genius925纯银施华洛世奇水晶吊坠</a></dd>
						<dd class="price">￥69.90</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/7.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">利仁2018M福满堂电饼铛 好用实惠</a></dd>
						<dd class="price">￥268.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.html" target="_blank"><img src="images/product/8.jpg" /></a></dt>
						<dd class="title"><a href="product-view.html" target="_blank">达派高档拉杆箱20寸 经典款式</a></dd>
						<dd class="price">￥198.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.html" target="_blank"><img src="images/product/9.jpg" /></a></dt>
						<dd class="title"><a href="product-view.html" target="_blank">爱国者MP4 全屏触摸多格式播放 4G</a></dd>
						<dd class="price">￥289.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/10.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">多美滋金装金盾3阶段幼儿配方奶粉</a></dd>
						<dd class="price">￥186.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/1.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">法国德菲丝松露精品巧克力500g/盒</a></dd>
						<dd class="price">￥108.0</dd>
					</dl>
				</li>
				<li>
					<dl>
						<dt><a href="product-view.jsp" target="_blank"><img src="images/product/2.jpg" /></a></dt>
						<dd class="title"><a href="product-view.jsp" target="_blank">乐扣普通型保鲜盒圣诞7件套</a></dd>
						<dd class="price">￥69.90</dd>
					</dl>
				</li>
			</ul>
			
			
			<div class="clear"></div>
			<div class="pager">
				<ul class="clearfix"> 
					<li><a href="#">上一页</a></li>
					<li class="current">1</li>
					<li><a href="#">2</a></li>
					<li><a href="#">3</a></li>
					<li><a href="#">4</a></li>
					<li><a href="#">5</a></li>
					<li><a href="#">下一页</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2010 北大青鸟 All Rights Reserved. 京ICP证1000001号
</div>
</body>
</html>